#include "vectorfunctions.h"
#include <iostream>

int main()
{
	int mat[10][10];
	int prin[100], sec[100];
	int i, j, k, row, col, sum=0;
	cout<<"Number of rows ";
	cin>>row;
	cout<<"Number of colons ";
	cin>>col;
	cout<<"Number k: ";
	cin>>k;
	for (i=0; i<row; i++)
		for (j=0; j<col; j++){
			cout<<"m["<<i<<"]["<<j<<"]= ";
			cin>>mat[i][j];	
		}
	for (i=0; i<row; ++i)
		for (j=0; j<col; ++j)
			if(i==0 || j==0 || i== row-1 || j== col-1)
				if(mat[i][j]%k==0)
					++sum;

			

	for (i=0; i<row; i++){
		for (j=0; j<col; j++)
			cout<<mat[i][j]<<" ";
		cout<<endl;	
		}
	cout<<sum <<" numbers are divisible with " <<k<<endl;

	
return 0;
}
